package com.example.demo.controller;

import com.example.demo.entity.Pic;
import com.example.demo.result.ResponseCode;
import com.example.demo.result.ResponseData;
import com.example.demo.service.PicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.List;

/**
 * (Pic)表控制层
 *
 * @author makejava
 * @since 2021-05-24 19:14:08
 */
@Api(value = "picApi")
@RestController
@RequestMapping("pic")
public class PicController {
    /**
     * 服务对象
     */
    @Autowired
    private PicService picService;

    @ApiOperation(value = "queryByType",notes = "通过。。。。。")
    @ApiImplicitParam(name = "type",value = "图片类型")
    @GetMapping("queryByType/{type}")
    public ResponseData queryByType(@PathVariable String type){
        List<Pic> pics = picService.queryByType(type);
        return new ResponseData(ResponseCode.SUCCESS,pics);
    }

}
